import { createRouter, createWebHashHistory } from 'vue-router'


export const constantRoutes = [ // 静态路由
    {
        path: '/',
        component: () => import('../views/Denglu/index.vue'),
        meta: { title: '登录', icon: 'Fold', },
    },
    {
        path: '/layout',
        component: () =>
            import('../layout/index.vue'),
        meta: { title: '首页', icon: 'Fold' },
    },
    {
        path: '/staff',
        component: () => import('../layout/index.vue'),

        meta: { title: '员工管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/staff/index.vue')
            }
        ]
    },




]

export const asyncRoutes = [ // 动态路由
   

    {
        path: '/Jiaoshi',
        component: () => import('../layout/index.vue'),
        meta: { title: '教师管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/jiaoshi/index.vue')
            }
        ]

    },

    {
        path: '/course',
        component: () => import('../layout/index.vue'),
        meta: { title: '课程管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/course/index.vue')
            }
        ]
    },
    {
        path: '/grade',
        component: () => import('../layout/index.vue'),
        meta: { title: '年级管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/Grade/index.vue')
            }
        ]
    },
    {
        path: '/xiaoqu',
        component: () => import('../layout/index.vue'),
        meta: { title: '校区管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/xiaoqu/index.vue')
            }
        ]
    },
    {
        path: '/xueyuan',
        component: () => import('../layout/index.vue'),
        meta: { title: '学员管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/xueyuan/index.vue')
            }
        ]
    },
    {
        path: '/lunBoTu',
        component: () => import('../layout/index.vue'),
        meta: { title: '轮播图管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/LunBoTu/index.vue')
            }
        ]
    },
    {

        path: '/role',
        component: () => import('../layout/index.vue'),
        meta: { title: '角色管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/role/index.vue')
            }]
    },
    {
        path: '/subject',
        component: () => import('../layout/index.vue'),
        meta: { title: '学科管理', icon: 'Fold', roles: ['admin'] },
        children: [
            {
                path: '',
                component: () => import('../views/Subject/index.vue')
            }
        ]
    },
]


const router = createRouter({
    history: createWebHashHistory(), // 方法
    routes: constantRoutes
})

export const resetRouter=()=>{
    
}

export default router